package translator.provider;

import java.util.LinkedHashSet;

public abstract class ATranslator<T extends ATranslator.IELang> {

    T actualFromLang;
    T actualToLang;

    public interface IELang {
        public String getDesc();
    }

    public abstract LinkedHashSet<String> translate(String wordToTranslate);
    public abstract T[] getSupportedLanguages();
    public abstract void langChanged();
    public T getFromLang() {
        return actualFromLang;
    }
    public T getToLang() {
        return actualToLang;
    }
    public void setFromLang(T fromLang) {
        actualFromLang = fromLang;
        langChanged();
    }
    public void setToLang(T toLang) {
        actualToLang = toLang;
        langChanged();
    }
    public void switchLanguages() {
        T temp = actualFromLang;
        actualFromLang = actualToLang;
        actualToLang = temp;
        langChanged();
    }

}
